
#ifndef JELLY_SHARE_SRC_UTILITY_LOG_H_
#define JELLY_SHARE_SRC_UTILITY_LOG_H_

#include <log4cplus/logger.h>
#include <log4cplus/configurator.h>
using namespace log4cplus;
using namespace log4cplus::helpers;

namespace jellyfish
{
	namespace utility
	{
		class log
		{
		public:
			inline static log& instance()
			{
				static log l;
				return l;
			}
			inline Logger& get_log()
			{
				return logger_;
			}
		private:
			log()
			{
				PropertyConfigurator::doConfigure(L"log4cplus.cfg");
				logger_ = Logger::getRoot();

			}
			Logger logger_;
		};
	}
}
#define LOG_TRACE(p) LOG4CPLUS_TRACE(jellyfish::utility::log::instance().get_log(), p);
#define LOG_DEBUG(p) LOG4CPLUS_DEBUG(jellyfish::utility::log::instance().get_log(), p);
#define LOG_INFO(p) LOG4CPLUS_INFO(jellyfish::utility::log::instance().get_log(), p);
#define LOG_WARNING(p) LOG4CPLUS_WARN(jellyfish::utility::log::instance().get_log(), p);
#define LOG_ERROR(p) LOG4CPLUS_ERROR(jellyfish::utility::log::instance().get_log(), p);
#define LOG_FATAL(p) LOG4CPLUS_FATAL(jellyfish::utility::log::instance().get_log(), p);


#endif  // JELLY_SHARE_SRC_UTILITY_LOG_H_
